<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title><?php echo C('sitename');?></title>
    <meta name="description" content="<?php echo ($web['description']); ?>" />
    <meta name="keywords" content="<?php echo ($web['keywords']); ?>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="/lzkong/blog/Public/Home/img/favicon.jpg">
    <link rel="stylesheet" href="/lzkong/blog/Public/Common/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/lzkong/blog/Public/Common/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/lzkong/blog/Public/Home/css/base.css" />
    <!--小飞机-->
    <link rel="stylesheet" href="/lzkong/blog/Public/Home/css/plane.css" />

    <script src="/lzkong/blog/Public/Home/js/jquery.js"></script>
    
    
    <script>window.onload=function(){window.loaded=!0};</script>
</head>
<body>
    <header class="main-header" style="background-image: url(/lzkong/blog/Uploads/banner1.jpg)">
        <!--小飞机-->
        <div class="plane">
            <div class="wings">
                <div class="fan">
                    <div class="fan-wings">
                        <div class="fan-a"></div>
                        <div class="fan-b"></div>
                        <div class="fan-c"></div>
                        <div class="fan-d"></div>
                    </div>
                </div>
                <div class="cat">
                    <div class="legs"></div>
                </div>
            </div>
            <div class="wheel">
                <div class="left"></div>
                <div class="right"></div>
            </div>
        </div>

    </header>

    <nav class="main-navigation">
        <div class="container">
            <div class="row">
                <div class="col-sm-12">
                    <div class="navbar-header">
                        <span class="nav-toggle-button collapsed" data-toggle="collapse" data-target="#main-menu">
                            <span class="sr-only">Toggle navigation</span>
                            <i class="fa fa-bars"></i>
                        </span>
                    </div>
                    <div class="collapse navbar-collapse" id="main-menu">
                        <ul class="menu">
                            <?php if(is_array($nav_list)): $i = 0; $__LIST__ = $nav_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$row): $mod = ($i % 2 );++$i;?><li <?php if($active == $row['active']): ?>class="nav-current"<?php endif; ?> role="presentation">
                                    <a href="<?php echo U($row['url']);?>"><?php echo ($row['name']); ?></a>
                                </li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </nav>
    
    <section class="content-wrap">
        <div class="container">
            <div class="row">
                <main class="col-lg-10 col-lg-push-1 main-content">
                    <article class="post">
                        <div class="post-head">
                            <h1 class="post-title"><?php echo ($Article['a_title']); ?></h1>
                            <div class="post-meta">
                                <time class="post-date" title="<?php echo ($Article['create_time']); ?>">
                                    <i class="fa fa-clock-o"></i>
                                    <?php echo (date("Y-m-d H:i",$Article["create_time"])); ?>
                                </time>
                            </div>
                        </div>
                        <div class="post-content">
                            <?php echo ($Article['a_remark']); ?>
                            <p><?php echo ($Article['a_content']); ?></p>
                        </div>
                        <footer class="post-footer clearfix">
                            <!--评论-->
                            <h4 class="bg-main text-white padding">评论区</h4>
                            <div class="dynamic-box">
                                <div class="comment-body">

                                    <?php if(is_array($comment)): $i = 0; $__LIST__ = $comment;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="media">
                                        <div class="media-left">
                                            <a href="#">
                                                <img class="media-object" width="60" height="60" src="/lzkong/blog<?php echo ($vo["picture"]); ?>" alt="...">
                                            </a>
                                        </div>
                                        <div class="media-body">
                                            <a class="reply-btn pull-right" data-toggle="review" data-id="<?php echo ($vo["id"]); ?>" data-username="<?php echo ($vo["username"]); ?>" href="javascript:;" reply="">回复<i></i></a>
                                            <h4 class="media-heading"><?php echo ($vo["username"]); ?></h4>
                                            <p><?php echo ($vo["comment"]); ?></p>

                                            <?php if(is_array($vo["child"])): $i = 0; $__LIST__ = $vo["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><div class="media-left">
                                                        <a href="#">
                                                            <img class="media-object" width="60" height="60" src="/lzkong/blog<?php echo ($v["picture"]); ?>" alt="...">
                                                        </a>
                                                    </div>
                                                    <div class="media-body">
                                                        <a class="reply-btn pull-right" data-toggle="review" data-id="<?php echo ($v["id"]); ?>" data-username="<?php echo ($v["username"]); ?>" href="javascript:;" reply="">回复<i></i></a>
                                                        <h4 class="media-heading"><?php echo ($v["username"]); ?></h4>
                                                        <p><?php echo ($v["comment"]); ?></p>

                                                        <?php if(is_array($v["child"])): $i = 0; $__LIST__ = $v["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v3): $mod = ($i % 2 );++$i;?><div class="media-left">
                                                                    <a href="#">
                                                                        <img class="media-object" width="60" height="60" src="/lzkong/blog<?php echo ($v3["picture"]); ?>" alt="...">
                                                                    </a>
                                                                </div>
                                                                <div class="media-body">
                                                                    <a class="reply-btn pull-right" data-toggle="review" data-id="<?php echo ($v3["id"]); ?>" data-username="<?php echo ($v3["username"]); ?>" href="javascript:;" reply="">回复<i></i></a>
                                                                    <h4 class="media-heading"><?php echo ($vo["username"]); ?></h4>
                                                                    <p><?php echo ($vo["comment"]); ?></p>
                                                                </div><?php endforeach; endif; else: echo "" ;endif; ?>
                                                    </div><?php endforeach; endif; else: echo "" ;endif; ?>
                                        </div>
                                        </div><?php endforeach; endif; else: echo "" ;endif; ?>

                                </div>
                                <div class="comment" style="margin-top: 10px;">
                                    <form class="clearfix comment-form" action="<?php echo U('Article/comment');?>" method="post">
                                        <input type="hidden" name="cid" value="<?php echo ($Article["a_id"]); ?>">
                                        <input type="hidden" name="uid" value="<?php echo (session('uid')); ?>" />
                                        <input type="hidden" name="review_id" value="0">
                                        <div class="form-group">
                                            <textarea class="form-control" rows="4" placeholder="写下你的评论" name="content"></textarea>
                                        </div>
                                        <div class="clearfix">
                                            <a href="javascript:;" data-toggle="face"><i class="iconfont icon-biaoqing"></i></a>
                                            <button type="submit" class="btn btn-default" data-loading-text="请稍后...">回复</button>
                                            <a class="margin-left" data-toggle="close" href="javascript:;">取消</a>
                                        </div>
                                    </form>
                                </div>
                            </div>

                            <!--评论结束-->

                        </footer>
                    </article>
                    <div class="prev-next-wrap clearfix">
                        <div class="a-up pull-left">
                            <p>上一篇：
                                <?php if($down['a_id'] == 0): ?><a title='没有了'>&nbsp;没有了</a>
                                    <?php else: ?>
                                    <a title='<?php echo ($down["a_title"]); ?>' href="<?php echo U('Article/index',array('a_id'=>$down['a_id']));?>"><?php echo ($down["a_title"]); ?></a><?php endif; ?>
                            </p>
                        </div>
                        <div class="a-down pull-right">
                            <p>下一篇：
                                <?php if($up['a_id'] == 0): ?><a title='没有了'>&nbsp;没有了</a>
                                    <?php else: ?>
                                    <a title='<?php echo ($up["a_title"]); ?>' href="<?php echo U('Article/index',array('a_id'=>$up['a_id']));?>"><?php echo ($up["a_title"]); ?></a><?php endif; ?>
                            </p>
                        </div>
                    </div>
                </main>
            </div>
        </div>
    </section>
    <script type="text/javascript">
        $(function() {
            //插入回复表单
            $(".dynamic-box").on('click', '[data-toggle="review"]', function(event) {
                var $form = $(".dynamic-box").find('.comment-form');
                var $textarea = $form.find("[name='content']");
                $form.appendTo($(this).next().next());

                $form.find(':hidden[name=review_id]').val($(this).data('id'));
                //对回复回复的处理
                if ($(this).data('username')!=='') {
                    $textarea.val('回复 @' + $(this).data('username') + ' : ');
                } else {
                    $textarea.val('');
                }
                moveEnd($textarea.get(0));
                event.stopPropagation();
            });

            //点击评论框以外的地方，重置评论表单
            /*$(document).click(function() {
             // alert(1111111111);
             var $form = $(".dynamic-box").find('.comment-form');
             if ($form.length > 0) {
             if ($form.find(':hidden[name=review_id]').val() !== '0') {
             $form.parents(".dynamic-box").find(".comment-form").before($form);
             $form.find(':hidden[name=review_id]').val(0);
             $form.find('textarea').val('');
             }
             }
             });*/
            //关闭
            $(".dynamic-box").on('click', "[data-toggle='close']", function(event) {
                var $form = $(".dynamic-box").find('.comment-form');
                if ($form.length > 0) {
                    if ($form.find(':hidden[name=review_id]').val() !== '0') {
                        $form.parents(".dynamic-box").find(".comment-form").before($form);
                        $form.find(':hidden[name=review_id]').val(0);
                        $form.find('textarea').val('');
                    }
                }
                $(this).parents('.comment-form').remove();
                $form.appendTo($('.comment'));
                event.stopPropagation();
            });

            $(".dynamic-box").on('click', 'textarea', function(event) {
                event.stopPropagation();
            });

        });
    </script>

    <footer class="main-footer">
        <div class="container">
            <div class="row">
                <div class="col-sm-4">
                    <div class="widget">
                        <h4 class="title">最新文章</h4>
                        <div class="content recent-post">
                        <?php if(is_array($s_article)): $i = 0; $__LIST__ = $s_article;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="recent-single-post">
                                <a href="<?php echo U('Article/index',array('a_id'=>$vo['a_id']));?>" class="post-title"><?php echo ($vo['a_title']); ?></a>
                                <div class="date">发布时间：<?php echo (date("Y-m-d H:i",$vo["create_time"])); ?></div>
                            </div><?php endforeach; endif; else: echo "" ;endif; ?>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="widget">
                        <h4 class="title">标签云</h4>
                        <div class="content tag-cloud">
                        <?php if(is_array($tag)): $i = 0; $__LIST__ = $tag;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$tag): $mod = ($i % 2 );++$i;?><a href="<?php echo U('Article/index',array('a_id'=>$tag['a_id']));?>"><?php echo ($tag['a_keyword']); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
                        </div>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="widget">
                        <h4 class="title">友情链接</h4>
                        <div class="content tag-cloud friend-links">
                            <?php if(is_array($link)): $i = 0; $__LIST__ = $link;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fl): $mod = ($i % 2 );++$i;?><a href="<?php echo ($fl['url']); ?>" title="<?php echo ($fl['name']); ?>" target="_blank"><?php echo ($fl['name']); ?></a><?php endforeach; endif; else: echo "" ;endif; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </footer>
    <div class="copyright">
        <div class="container">
            <div class="row">
                <div class="col-sm-12">
                    <span>Copyright &copy; <a href="http://www.findz.cn/">findz.cn</a></span> |
                    <span><a href="http://www.miibeian.gov.cn/" target="_blank"><?php echo ($web['icp']); ?></a></span>
                </div>
            </div>
        </div>
    </div>
    <div id="loadProgress" class="progress progress-top"></div>
    <div class="rotate" id="rotate">
        <div class="rotate-icon"></div>
    </div>
    <a href="#" id="back_to_top"><i class="fa fa-angle-up"></i></a>
    <div class="hidden"><?php echo ($web['tj']); ?></div>
    <script src="/lzkong/blog/Public/Common/js/jquery.min.js"></script>
    <script src="/lzkong/blog/Public/Common/js/bootstrap.min.js"></script>
    <script src="/lzkong/blog/Public/Home/js/base.js"></script>
    
    <script type='text/javascript'>
        $({property: 0}).animate({property: 100}, {
            duration: 3000,
            step: function() {
                var percentage = Math.round(this.property);

                $('#loadProgress').css('width',  percentage+"%");

                if(percentage == 100) {
                    $("#loadProgress").addClass("done");//完成，隐藏进度条
                    $("#rotate").addClass("done");//完成，隐藏进度条
                }
            }
        });
    </script>
</body>
</html>